'''
Descripttion: 
Author: 李增辉
Date: 2024-02-26 21:01:38
LastEditors: 李增辉
LastEditTime: 2024-02-26 21:07:59
'''
import pymysql
db = pymysql.connect(host='localhost', port=3306, user='root',
                     password='guang', database='crawler', charset='utf8')
cursor = db.cursor()  # 获取游标
cursor.execute("update demo_one set title='更改后的名称' where id = 3")  # 执行sql语句
db.commit()  # 提交
db.close()  # 关闭数据库连接
